<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/upload/jquery.ocupload-1.1.2.js"></script>
</head>
<body>
<iframe name="myFrame" style="display:none"></iframe>
<form target="myFrame" action="abc.action" method="post" enctype="multipart/form-data">
	<input type="file" name="upload1">
	<input type="submit" value="上传">
</form>

<hr>
<!-- Jquery ocUpload:一键上传 原理：调用upload方法动态新增html元素 -->
第一步：在页面中提供任意html元素 <br>
第二步：在页面加载完成后调用 upload方法<br>
<a id="myBtn" href="#">上传</a>
<script type="text/javascript">
	$(function(){
		$("#myBtn").upload({
			action:'xyz.action',//将来发出请求
			name:'upload2'      //默认提交参数名：file
		});
	})
</script>
</body>
</html>